<template>
  <el-card class="flashing-alert history-frame">
    <div class="history-tip">
      <div class="history-tip-content">当前正在查看历史记录</div>
      <UserItem :user="history.user" :selected="true" class="content-item" />
      <el-button class="content-item" @click="$emit('requireExit')">退出查看</el-button>
    </div>
  </el-card>
</template>

<script>
export default {
  name: 'HistoryTip',
  components: {
    UserItem: () => import('../UserItem')
  },
  props: {
    history: { type: Object, required: true }
  }
}
</script>
<style lang="scss" scoped>
@import '@/styles/animation';
@import '@/styles/element-variables';
.history-frame {
  position: fixed;
  right: 2rem;
  top: 10rem;
}
.history-tip {
  display: flex;
  flex-direction: column;
  align-items: center;
  .history-tip-content {
    color: $--color-success;
    font-size: 1.2rem;
  }
  .content-item {
    margin-top: 1rem;
  }
}
</style>
